package com.godyao.controller;

import com.godyao.mvcframework.annotations.Autowire;
import com.godyao.mvcframework.annotations.Controller;
import com.godyao.mvcframework.annotations.RequestMapping;
import com.godyao.mvcframework.annotations.Security;
import com.godyao.service.MyService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/temp")
@Security("admin")
public class MyController {

    @Autowire
    private MyService myService;

    @RequestMapping("/getName")
    @Security({"admin", "zhangsan","lisi", "wangwu"})
    public String getNameById(HttpServletRequest request, HttpServletResponse response, Integer id) {
        return myService.getNameById(id);
    }

    @RequestMapping("/getName2")
    public String getNameById2(HttpServletRequest request, HttpServletResponse response, Integer id) {
        return myService.getNameById(id);
    }
}
